﻿@model KPIS.GERP.OMVC.Models.LogOnModel
@{ 
    ViewBag.Title = "Login เข้าสู่ระบบ"; 
    Layout = "~/Views/Shared/_LayoutForNonLogin.cshtml";
}

<div class="login" style="margin-top:200px ">

@using (Html.BeginForm("LogIn", "Account", FormMethod.Post, new Dictionary<string, object>{{"autocomplete","off"}})) {
    @Html.AntiForgeryToken()
        
    <table>
        <tr style="vertical-align:top;">
            <td style="padding: 0 40px 0 0; text-align:center; ">
                <h1 style="font-family:Bariol_Regular; ">
                    GERP
                </h1>
                <h6>Approval Process</h6>
            </td>
            <td>
                <div style="
background-color: rgb(25, 157, 152);
border-right:solid 1px rgb(30, 190, 184);
width:1px; 
height: 240px; " />
            </td>
            <td style="padding: 0 0 0 40px;">
                <div class="editor-label">
                    @Html.LabelFor(m => m.UserName)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.UserName)
                    <br/>@Html.ValidationMessageFor(m => m.UserName)
                </div>
                <br />

                <div class="editor-label">
                    @Html.LabelFor(m => m.Password)
                </div>
                <div class="editor-field">
                    @Html.PasswordFor(m => m.Password)
                    <br/>@Html.ValidationMessageFor(m => m.Password)
                </div>
                    @Html.ValidationSummary(true, "ไม่สามารถเข้าระบบได้ แก้ไขข้อมูลใหม่แล้วลองอีกครั้ง")
                <br />
                <br /> 
                    <input type="submit" value="เข้าระบบ" /> 
            </td>
        </tr>
    </table>    
}
    
            <!-- Permanent disable feature (Easy login on developing)-->
@*{
        foreach (var user in new GERPContext().Users.Include(o=>o.Employee).Where(o=>o.RecordStatus!="D"))
        {
            <text>
                @Html.Raw("<div class='inline'>")
                    @using (Html.BeginForm())
                    {
                        @Html.AntiForgeryToken()
                        @Html.HiddenFor(m => m.UserName, new {@Value =  user.Code}) 
                        @Html.HiddenFor(m => m.Password, new {@Value =  user.Password})
                        <input type="submit" style="background: grey" value="@(user.Employee != null ? user.Employee.FullName:user.Code)" />
                    }
                @Html.Raw("</div>")
            </text>
        }
        @Html.Raw("</div>")
}*@
</div> 